package edu.serg.mbar.algorithms.functions;

import java.util.Vector;

import org.apache.log4j.Logger;

import edu.serg.mbar.ucon.AttributeManager;
import edu.serg.mbar.ucon.interfaces.IFunction;

public class StringEqualIgnoreCase implements IFunction {
	private static Logger log = Logger.getLogger(AttributeManager.class);
	
	@Override
	/**
	 * This Function Compares two strings for equality without considering the case of the letters
	 * @param
	 * 		The Vector of two objects to be considered as strings and compared subsequently
	 */
	public Object evaluate(Vector<Object> param) {
		// TODO Auto-generated method stub
		
		String firstString =(String ) param.elementAt(0);
		String secondString= (String) param.elementAt(1);
		boolean equal =firstString.equalsIgnoreCase(secondString);
		if (equal==true ){
			log.debug("Both Strings '"+firstString +"' and '" + secondString +"' are EQUAL");
		}
			else{
				log.debug ("Both Strings are not equal '"+firstString +"', '"+ secondString +"'");
			}
				
		
		return equal;
	}

}
